package com.bit.fist.websocketdemo.common.entity;

import lombok.Data;

@Data
public class ResponseEntity {
    private boolean success = false;
    private Object data;
    private String msg;
    public static ResponseEntity successToResponse(Object o){
        ResponseEntity responseEntity = new ResponseEntity();
        responseEntity.setData(o);
        responseEntity.setSuccess(true);
        responseEntity.setMsg("成功");
        return responseEntity;
    }
    public static ResponseEntity failedToResponse(){
        ResponseEntity responseEntity = new ResponseEntity();
        responseEntity.setMsg("失败");
        return responseEntity;
    }
}
